home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Prog / B-C / CArrangeList 1.01ß.sit / CArrangeList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-15  |  2.4 KB  |  89 lines  |  [TEXT/KAHL]

  1. #define _H_CArrangeList
  2.  
  3. typedef short    (*ShortFunc)();
  4. typedef long    *LongPtr;
  5.  
  6. #include "CBureaucrat.h"
  7. #include "CPanorama.h"
  8. #include "CScrollPane.h"
  9.  
  10. struct CArrangeList:CBureaucrat
  11. {
  12.     CPanorama    *itsPanorama;
  13.     CScrollPane    *itsScrollPane;
  14.     short        hIndent;
  15.     short        vIndent;
  16.     short        rows;
  17.     short        rowWidth;
  18.     short        rowHeight;
  19.     short        currentSelection;
  20.     Boolean        dirty;
  21.     long        clickTime;
  22.     short        clickRow;
  23.     
  24.     LongHandle    itsOrder;
  25.     LongHandle    itemOffsets;
  26.     Handle        itsItems;
  27.     
  28.     ShortFunc        compareProc;
  29.     VoidFunc        doubleProc;
  30.     
  31.     void        IArrangeList(CView *theEnclosure,CBureaucrat *theSupervisor,
  32.                     short theWidth,short theHeight,short theHEncl,
  33.                     short theVEncl,Boolean hasHoriz,Boolean hasVert,
  34.                     Boolean hasSizeBox,short theRows,short theRowWidth,
  35.                     short theRowHeight,ShortFunc theCompareProc,
  36.                     VoidFunc theDoubleProc);
  37.     void        Dispose(void);
  38.  
  39.     void        GetIndents(short *theHIndent,short *theVIndent);
  40.     void        GetRowCount(short *rowCount);
  41.     void        GetRowDimensions(short *theWidth,short *theHeight);
  42.     void        GetSelection(short *theSelection);
  43.     Boolean        IsDirty(void);
  44.     void        SetIndents(short theHIndent,short theVIndent,
  45.                     Boolean redraw);
  46.     void        SetRowDimensions(short theWidth,short theHeight,
  47.                     Boolean redraw);
  48.     void        SetSelection(short theSelection);
  49.     void        SetDirty(Boolean isDirty);
  50.     void        SetCompareProc(ShortFunc theFunc);
  51.     void        SetDoubleProc(VoidFunc theFunc);
  52.  
  53.     void        AddRow(short count,short rowNum,Boolean redraw);
  54.     void        DeleteRow(short count,short rowNum,Boolean redraw);
  55.     
  56.     void        SetRow(Ptr dataPtr,long dataLen,short rowNum,
  57.                     Boolean redraw);
  58.     void        DrawRow(register short rowNum);
  59.     void        InvertRow(register short rowNum);
  60.     
  61.     Boolean        ValidRow(register short rowNum);
  62.     void        Draw(void);
  63.     
  64.     void        DoClick(Point hitPt,short modifierKeys,long when);
  65.     Ptr            GetRowOffset(register short rowNum);
  66.     long        GetRowSize(register short rowNum);
  67.     
  68.     void        Sort(short left,short right);
  69.     Boolean        Search(register Ptr dataPtr,register short dataLen,
  70.                     short *theRow);
  71. };
  72.  
  73. struct CListPanorama:CPanorama
  74. {
  75.     void        Draw(Rect *area);
  76.     void        DoClick(Point hitPt,short modifierKeys,long when);
  77. };
  78.  
  79. struct CArrangeTask:CMouseTask
  80. {
  81.     CArrangeList    *itsList;
  82.     short        lastItem;
  83.     Boolean        arranging;
  84.     
  85.     void        IArrangeTask(CArrangeList *theList);
  86.     void        BeginTracking(Point *startPt);
  87.     void        KeepTracking(Point *currPt,Point *prevPt,Point *startPt);
  88.     void        EndTracking(Point *currPt,Point *prevPt,Point *startPt);
  89. };